/**
 * CS 307 Red Cross Calendar
 * @author Kevin Barlow
 * @author David Barnes
 * @author Max Cohen
 * @author Yoongu Kang
 * @author Matt Lathrop
 * @author Thomas Maley
 */
package com.cs307.redcross.client;

import java.io.Serializable;
import java.util.Date;

public class LogFileEntry implements Serializable {
	private static final long serialVersionUID = 1L; // needed in order to implement Serializable
	private String logAction; // the action that is being logged
	private String user;
	private boolean developerOnly;
	private int sessionID;
	
	public boolean isDeveloperOnly() {
		return developerOnly;
	}

	public void setDeveloperOnly(boolean developerOnly) {
		this.developerOnly = developerOnly;
	}

	public String getUser() {
		return user;
	}

	public void setUser(String user) {
		this.user = user;
	}

	public Date getTime() {
		return time;
	}

	public void setTime(Date time) {
		this.time = time;
	}

	public int getId() {
		return id;
	}

	public void setLogAction(String logAction) {
		this.logAction = logAction;
	}

	private int id;
	private Date time;
	/**
	 * Constructs a blank LogFileEntry
	 */
	public LogFileEntry() {
		this(-1, "", "", true);
	}
	
	/**
	 * Constructs LogFileEntry with the given log
	 */
	public LogFileEntry(int SID, String user, String logAction, boolean devOnly) {
		this.user = user;
		this.id = -1;
		this.time = new Date();
		this.logAction = logAction;
		this.sessionID = SID;
		this.developerOnly = devOnly;
	}
	
	@Override
	public String toString() {
		return "user=" + user+ ", time=" + time + ", logAction=" + logAction;
	}

	/**
	 * 
	 */
	public void action() {
		//TODO: not sure if this is needed...
	}
	
	// getters *******************************************************
	
	/**
	 * @return the log string
	 */
	public String getLogAction() {
		return this.logAction;
	}

	public void setId(int parseInt) {
		this.id = parseInt;
		
	}

	public void setSessionID(int sessionID) {
		this.sessionID = sessionID;
	}

	public int getSessionID() {
		return sessionID;
	}
}
